package com.geotmt.billingcenter.modules.hive.mapper;

import com.geotmt.billingcenter.common.entry.ConsumeStatisEntry;
import com.geotmt.billingcenter.modules.hive.provider.ConsumeHiveProvider;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.SelectProvider;

import java.util.List;

@Mapper
public interface ConsumeHiveMapper {

    /**
     * 测试
     * @param tabelName
     */
    @InsertProvider(type = ConsumeHiveProvider.class, method = "createTest")
    void createTest(String tabelName);

    /**
     * 查询Hive表中该日期消耗的List
     * @param dayFlag
     * @return
     */
    @SelectProvider(type = ConsumeHiveProvider.class, method = "listForDay")
    List<ConsumeStatisEntry> listConsume(String dayFlag);

    /**
     * 查询hive中某段时间内的消耗List
     * @param startDay
     * @param endDay
     * @return
     */
    @SelectProvider(type = ConsumeHiveProvider.class, method = "listForDate")
    List<ConsumeStatisEntry> listConsume2(@Param(value = "startDay") String startDay,
                                         @Param(value = "endDay") String endDay);
}
